namespace OomfTest
{
    public class Address
    {
        private readonly string hashKey;
        private string priority;
        public Address() {}

        public Address(string id, string hashKey)
        {
            Id = id;
            this.hashKey = hashKey;
        }

        public string HashKey
        {
            get { return hashKey; }
        }

        public string Id { get; private set; }
        public string HouseNo { get; set; }
        public string AddressLine1 { get; set; }
        public string AddressLine2 { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string Country { get; set; }
        public string PinCode { get; set; }

        public string Priority
        {
            set { priority = value; }
        }

        public bool Equals(Address obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            return Equals(obj.priority, priority);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (Address)) return false;
            return Equals((Address) obj);
        }

        public override int GetHashCode()
        {
            return (priority != null ? priority.GetHashCode() : 0);
        }
    }
}